//
//  HWVipMedalProtocol.swift
//  HWanGame
//
//  Created by 王昌健 on 2021/12/13.
//  Copyright © 2021 94Wan. All rights reserved.
//

import UIKit

class HWVipMedalProtocol: NSObject {
    var models:[HWHeadPortraitFrameModel]?
    var receiveButtonClick:((_:String)->())?
}
extension HWVipMedalProtocol:UITableViewDelegate,UITableViewDataSource {
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return models?.count ?? 0
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let medalCell = HWVipMedalCell.cellWithTableView(tableView: tableView)
        medalCell.model = models?[indexPath.row]
        medalCell.receiveButtonClick = {
            id in
            self.receiveButtonClick?(id)
        }
        return medalCell
    }
    
}
